import java.util.*;

public class Solution1817 {
    public int[] findingUsersActiveMinutes(int[][] logs, int k) {
        Map<Integer, Set<Integer>> map=new HashMap<>();
        for (int[] log : logs) {
            if (!map.containsKey(log[0])){
                map.put(log[0],new HashSet<>());
            }
            map.get(log[0]).add(log[1]);
        }
        int[] ans=new int[k];
        for (Map.Entry<Integer, Set<Integer>> integerSetEntry : map.entrySet()) {
            if (integerSetEntry.getValue().size()-1<k){
                ans[integerSetEntry.getValue().size()-1]++;
            }
        }
        return ans;
    }

    public static void main(String[] args) {
        System.out.println(Arrays.toString(new Solution1817().findingUsersActiveMinutes(new int[][]{{0, 5}, {1, 2}, {0, 2}, {0, 5}, {1, 3}}, 5)));
    }
}
